package com.losdun.cms.service.impl;

import java.util.List;
import com.losdun.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.losdun.cms.mapper.GuestMessageMapper;
import com.losdun.cms.domain.GuestMessage;
import com.losdun.cms.service.IGuestMessageService;

/**
 * 网站留言Service业务层处理
 * 
 * @author swordye
 * @date 2025-08-26
 */
@Service
public class GuestMessageServiceImpl implements IGuestMessageService 
{
    @Autowired
    private GuestMessageMapper guestMessageMapper;

    /**
     * 查询网站留言
     * 
     * @param id 网站留言主键
     * @return 网站留言
     */
    @Override
    public GuestMessage selectGuestMessageById(Long id)
    {
        return guestMessageMapper.selectGuestMessageById(id);
    }

    /**
     * 查询网站留言列表
     * 
     * @param guestMessage 网站留言
     * @return 网站留言
     */
    @Override
    public List<GuestMessage> selectGuestMessageList(GuestMessage guestMessage)
    {
        return guestMessageMapper.selectGuestMessageList(guestMessage);
    }

    /**
     * 新增网站留言
     * 
     * @param guestMessage 网站留言
     * @return 结果
     */
    @Override
    public int insertGuestMessage(GuestMessage guestMessage)
    {
        guestMessage.setCreateTime(DateUtils.getNowDate());
        return guestMessageMapper.insertGuestMessage(guestMessage);
    }

    /**
     * 修改网站留言
     * 
     * @param guestMessage 网站留言
     * @return 结果
     */
    @Override
    public int updateGuestMessage(GuestMessage guestMessage)
    {
        guestMessage.setUpdateTime(DateUtils.getNowDate());
        return guestMessageMapper.updateGuestMessage(guestMessage);
    }

    /**
     * 批量删除网站留言
     * 
     * @param ids 需要删除的网站留言主键
     * @return 结果
     */
    @Override
    public int deleteGuestMessageByIds(Long[] ids)
    {
        return guestMessageMapper.deleteGuestMessageByIds(ids);
    }

    /**
     * 删除网站留言信息
     * 
     * @param id 网站留言主键
     * @return 结果
     */
    @Override
    public int deleteGuestMessageById(Long id)
    {
        return guestMessageMapper.deleteGuestMessageById(id);
    }
}
